<%@page import="java.util.List"%>

<div>
    <%
        List<String> roles = (List<String>) session.getAttribute("UserRoles");
        if (roles != null) {
            if (roles.contains("Admin")) {
    %>
    <h2>Admin Menu</h2>
    <div class="leftBar" style="margin-bottom: 10px;">
        <b>User</b><p>
            <a href="${pageContext.request.contextPath}/admin/users">All Users</a><p>
            <a href="${pageContext.request.contextPath}/admin/createUser">Create User</a><p>
    </div>
    <div class="leftBar">
        <b>Groups</b><p>
            <a href="${pageContext.request.contextPath}/admin/groups">All Groups</a><p>
            <a href="${pageContext.request.contextPath}/admin/createGroup">Create Group</a><p>                        
    </div>
    <%
            }
            if (roles.contains("WHEmployee") || roles.contains("Admin")) {
    %>
    <h2>Warehouse Menu</h2>
    <div class="leftBar">
        <b>Catalog</b><p>
            <a href="${pageContext.request.contextPath}/warehouse/products">List of products</a><p>
            <a href="${pageContext.request.contextPath}/warehouse/addProduct">Create new product</a><p>                        
    </div>
    <div class="leftBar">
        <b>Orders</b><p>
            <a href="${pageContext.request.contextPath}/warehouse/orders">List of orders</a><p>                                    
    </div>
    <div class="leftBar">
        <b>Reports</b><p>
            <a href="${pageContext.request.contextPath}/warehouse/report">Most popular guitars</a><p>
            <a href="${pageContext.request.contextPath}/warehouse/shipmentOrder">Shipment orders</a><p>                                    
    </div>
    <%      }
            if (roles.contains("Courier") || roles.contains("Admin")) {
    %>
    <h2>Courier Menu</h2>
    <div class="leftBar">
        <b>Orders</b><p>
            <a href="${pageContext.request.contextPath}/courier/orders">View orders for delivery</a><p>
    </div>
    <%      }
        }
    %>
    <h2>Customer Menu</h2>
    <div class="leftBar">
        <b>Orders</b><p>
            <a href="${pageContext.request.contextPath}/track">View orders by tracking number</a><p>                  
    </div>
    <div class="leftBar">
        <b>Catalog</b><p>
            <a href="${pageContext.request.contextPath}">View guitars</a><p>                                    
    </div>
</div>